#!.env/bin/python
# coding:utf-8
from flask_restful import Api
from src.utils.blue_prints import Api_v1_bp
from . import auth

__author__ = 'Methew Pan'
__create__time = '20180429'
__edit__time = '201800603'

__api_1_version__ = '/api/V0.1/'

api_v1 = Api(Api_v1_bp, default_mediatype="application/json")

Api_v1_list = [
    # socail login first step: @windowName type[4]string[8]time[8]
    (auth.SendWindowName, '/auth/send-window-name'),
    (auth.GetAuthUrl, '/auth/get-auth-url/<string:provider>'),
    # http://127.0.0.1:3000/Api/v1/send-code/
    (auth.SendCode, '/auth/send-code'),  # socail login open window when close
    (auth.VerifySocial, '/auth/verify-social/<string:provider>'),  #
    (auth.SendVerificationEmail, '/auth/send-auth-email'),  # email login
    (auth.CheckUser, '/auth/checkUser'),
    (auth.Regist, '/auth/regist'),
    (auth.Test, '/auth/test')
]

for obj, url in Api_v1_list:
    api_v1.add_resource(obj, url)
